Skip to content

serial_port: refactoring serial read to use readyRead signal#37

Merged
jciberlin merged 1 commit into
masterfrom
pr-refactoring_serial_read
Apr 20, 2022
Merged

serial_port: refactoring serial read to use readyRead signal#37
jciberlin merged 1 commit into
masterfrom
pr-refactoring_serial_read

Conversation

@Igor-Misic

@Igor-Misic Igor-Misic commented Apr 19, 2022

Copy link
Copy Markdown
Member

This PR is replacing Qt waitForReadyRead with new WaitForReadyRead function that relay on readRead signal.
The new functionality is using a buffer for collecting data. Once WaitForReadyRead exits, buffered data can be copied, after what will be cleared and ready for new usage.

Benefits:

  • it waits up to 10 ms for new data to arrive on serial communication. This is useful when the sender is sending data in chunks.
  • it fixes waitForReadyRead for Windows where functions wait the full timeout time, which causes a bad user experience.

@Igor-Misic Igor-Misic force-pushed the pr-refactoring_serial_read branch from 4d98036 to cba8bdd Compare April 19, 2022 19:51
@Igor-Misic Igor-Misic requested a review from jciberlin April 19, 2022 19:55
@jciberlin jciberlin merged commit de56b74 into master Apr 20, 2022
@jciberlin jciberlin deleted the pr-refactoring_serial_read branch April 20, 2022 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants